package com.huonan.test.test2;

import cn.hutool.core.io.FileUtil;
import java.io.File;
import java.util.List;
import java.util.concurrent.CountDownLatch;

/**
 * @Description TODO
 * @Author lxp
 * @Date 2022/12/13 上午9:52
 * @Version V1.0
 **/
public class ListFiles implements Runnable {
    private String path;
    private CountDownLatch countDownLatch;

    public ListFiles(String path, CountDownLatch countDownLatch) {
        this.path = path;
        this.countDownLatch = countDownLatch;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public CountDownLatch getCountDownLatch() {
        return countDownLatch;
    }

    public void setCountDownLatch(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        List<String> list = FileUtil.readLines(new File(path), "UTF-8");
        System.out.println(list.size());
    }
}